package edu.nazarevych.portal.controller;

import java.util.List;
import java.util.Map;

import javax.validation.Valid;

import org.apache.commons.collections.map.LinkedMap;
import org.hibernate.classic.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import edu.nazarevych.portal.dao.HibernateSessionFactory;
import edu.nazarevych.portal.dao.RolesDao;
import edu.nazarevych.portal.dao.UserDao;
import edu.nazarevych.portal.entities.Roles;
import edu.nazarevych.portal.entities.User;

@Controller
public class UsersListController {
	
	private static final Logger logger = LoggerFactory
			.getLogger(UsersListController.class);
	
	@RequestMapping(value = "/users/list" ,method = RequestMethod.GET)
	public String listUsers(Map model) {
		UserDao dao = new UserDao();
		List<User> usersList = dao.findAll();
		model.put("usersList", usersList);
		return "usersList";
	}

}